From: Marco Trevisan (TreviƱo) Date: Tue, 30 Apr 2024 21:45:04 +0000 (+0200) Subject: shell-app: Do not allocate memory during GSpawnChildSetupFunc X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~263^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f6c161ec6e3afe183c41f8ade950c832eaa47d19;p=gnome-shell.git shell-app: Do not allocate memory during GSpawnChildSetupFunc The child context setup function used as launch GSpawnChildSetupFunc uses g_object_get that internally potentially allocates memory, making it not async-signal-safe and so not something that is safe to use in between fork and exec, so just use the simpler getter here. Note that the current implementation of app_child_setup() is safe already as sd_journal_stream_fd, dup2 and close are so. Part-of: (cherry picked from commit dcb5956dea9c46720feaa1773ca9488327e34f51) --- diff --git a/src/shell-app.c b/src/shell-app.c index 3b5df0aab..dcebc97da 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -1236,9 +1236,8 @@ static void child_context_setup (gpointer user_data) { ShellGlobal *shell_global = user_data; - MetaContext *meta_context; + MetaContext *meta_context = shell_global_get_context (shell_global); - g_object_get (shell_global, "context", &meta_context, NULL); meta_context_restore_rlimit_nofile (meta_context, NULL); }